<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" type="text/css" href="http://localhost:8080/CSS/paylist.css"/>
</head>
<body>
<div class="header">
    <div class="header_head">
        <div>
            <img src="http://localhost:8080/images/logo_touming.gif" width="200" height="65">
            <img src="http://localhost:8080/images/logotxt.png" >
        </div>
        欢迎使用APP管理平台
    </div>
    <!-- 中部 -->
    <div class="mation">
        <div class="mation_left">
            <ul>
                <% if(port_id == 1){%>
                <li>
                    <a href="/home">查询个人资料</a>
                </li>
                <li>
                    <a href="/chenck">更改登陆密码</a>
                </li>
                <li>
                    <a href="">查询本月工资条</a>
                </li>
                <% }else if(port_id == 2){ %>
                <li>
                    <a href="/home">查询个人资料</a>
                </li>
                <li>
                    <a href="/chenck">更改登陆密码</a>
                </li>
                <li>
                    <a href="/paylist">查询本月工资条</a>
                </li>
                <li>
                    <a href="/sel_permsg">查询员工信息</a>
                </li>
                <li>
                    <a href="/add_permsg">录入新员工信息</a>
                </li>

                <% }else{ %>
                <li>
                    <a href="/home">查询个人资料</a>
                </li>
                <li>
                    <a href="/chenck">更改登陆密码</a>
                </li>
                <li>
                    <a href="">查询本月工资条</a>
                </li>
                        <li>
                            <a href="/edu_update">制定学历薪资</a>
                        </li>
                        <li>
                            <a href="/sta_update">制定员工薪资</a>
                        </li>
                <li>
                    <a href="/sle_msgpay">查询员工薪资</a>
                </li><li>
                <a href="/add_msgpay">录入员工薪资</a>
            </li>

                <% }  %>
            </ul>
        </div>
        <div class="mation_mat">
            <table cellpadding="0" cellspacing="0" border="0" style="color: white; width: 99%; margin: 20px auto;">
                <tr align="center">
                    <th colspan="8" style="border: 0px;"><span style="color: red; " >温馨提醒：</span><label style="color: white;">请认真核对自己的个人信息，再进行确认工资。</label></th>
                </tr>
                <tr align="center">
                    <th >月份</th>
                    <th >底薪</th>
                    <th >岗位津贴</th>
                    <th >KBI效绩</th>
                    <th >提成</th>
                    <th >扣除五险一金</th>
                    <th >实发工资</th>
                    <th >是否确认</th>
                </tr>

                <% result.forEach( (item , index)=>{ %>
                <tr align="center">
                    <th ><%= item.month %></th>
                    <th ><%= item.edu_money %></th>
                    <th ><%= item.sta_money %></th>
                    <th ><%= item.kbi %></th>
                    <th ><%= item.perfor %></th>
                    <th ><%= 500 %></th>
                    <th ><%= (item.edu_money + item.sta_money + item.kbi + item.perfor ) - 500 %></th>
                    <th >
                        <% if(item.status == 1){ %>
                            <a href="javascript:;" class="btn" onclick="post('<%= item.month %>')"  id="sub" >确定</a>
                        <% }else { %>
                            <span style="padding: 2px 0; display: inline-block;">已确认</span>
                        <% } %>
                    </th>
                </tr>
                <% } ) %>

            </table>
        </div>
        <div class="mation_right">
            <img src="http://localhost:8080/images/head.jpg" />

            <table cellspacing="0" cellpadding="0" border="0" style="width: 100%; color: white;">
                <tr align="center">
                    <td>
                        <label>用户名:</label>
                    </td>
                    <td>
                        <label><%= loginame %></label>
                    </td>
                </tr>
                <tr align="center">
                    <td>
                        <label>职务:</label>
                    </td>
                    <td>
                        <label><%= port %></label>
                    </td>
                </tr> <tr align="center">
                <td>
                    <label>登录账号:</label>
                </td>
                <td>
                    <label><%= result[0].uid %></label>
                </td>
            </tr>
                <tr align="center">
                    <td>
                        <label>登录时间:</label>
                    </td>
                    <td>
                        <label><%= date %></label>
                    </td>
                </tr>

            </table>

            <a href="/logout" class="btn">退出登录</a>
        </div>
    </div>

    <!-- 低部 -->
    <div class="foot">
        <p style="color: gray;">Copyright 2018 Carporate WordPress Theme Theme by <span><a href="javascript:;" style="color: red; text-decoration: none;">ThimPress</a></span></p>
    </div>
</div>
</body>
</html>
<script type="text/javascript" src="http://localhost:8080/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
    function post(month){
        //console.log(month)
        $.post({
            url : '/paylist?month='+month,
            dataType : 'json',
            success : function (test){
                if(test){
                    window.location.href='/paylist';
                }
            }
        })
    }
</script>
